﻿// MT410




using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category4
{
  public class MT410 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagSequenceDefinition U0002;
    private static SwiftTagDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagChoiceDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagSubItemDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagDefinition U001A;

    [Description("Sending Bank’s TRN")]
    public MT410.SequenceClass[] Sequence
    {
      get
      {
        int index = -1;
        List<MT410.SequenceClass> list = new List<MT410.SequenceClass>();
        int count;
        do
        {
          ++index;
          MT410.SequenceClass sequenceClass = new MT410.SequenceClass((SwiftElement) this, index, false);
          count = this.ListTags((SwiftElement) sequenceClass).Count;
          if (count > 0)
            list.Add(sequenceClass);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    [Description("Sender to Receiver Information")]
    public Tag72 SenderToReceiverInformation_72
    {
      get
      {
        return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U001A);
      }
    }

    [Description("Sender to Receiver Information")]
    public Tag72 Tag72_SenderToReceiverInformation
    {
      get
      {
        return this.SenderToReceiverInformation_72;
      }
    }

    public MT410()
      : base(true)
    {
    }

    public MT410(SwiftMessage message)
      : base(message)
    {
    }

    public MT410.SequenceClass AddSequence()
    {
      return new MT410.SequenceClass((SwiftElement) this, this.Sequence.Length, true);
    }

    public void RemoveSequence(MT410.SequenceClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT410.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT410.MessageDefinition = new SwiftMessageDefinition("MT410", "Acknowledgement");
      MT410.U0002 = new SwiftTagSequenceDefinition("Sequence", "Sending Bank’s TRN");
      MT410.U0002.Multiple = true;
      MT410.U0003 = new SwiftTagDefinition("SendingBanksTRN_20", "Sending Bank’s TRN");
      MT410.U0003.TagName = ":20:";
      MT410.U0004 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT410.U0003.Elements.Add((SwiftDefinitionElement) MT410.U0004);
      MT410.U0002.Elements.Add((SwiftDefinitionElement) MT410.U0003);
      MT410.U0005 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT410.U0005.TagName = ":21:";
      MT410.U0006 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT410.U0005.Elements.Add((SwiftDefinitionElement) MT410.U0006);
      MT410.U0002.Elements.Add((SwiftDefinitionElement) MT410.U0005);
      MT410.U0007 = new SwiftTagChoiceDefinition("Choice", "");
      MT410.U0007.Multiple = true;
      MT410.U0008 = new SwiftTagDefinition("AmountAcknowledged_32A", "Amount Acknowledged");
      MT410.U0008.TagName = ":32A:";
      MT410.U000E = new SwiftTagSubItemDefinition("Date", "Date");
      MT410.U0008.Elements.Add((SwiftDefinitionElement) MT410.U000E);
      MT410.U000F = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT410.U0008.Elements.Add((SwiftDefinitionElement) MT410.U000F);
      MT410.U0010 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT410.U0008.Elements.Add((SwiftDefinitionElement) MT410.U0010);
      MT410.U0007.Elements.Add((SwiftDefinitionElement) MT410.U0008);
      MT410.U0011 = new SwiftTagDefinition("AmountAcknowledged_32B", "Amount Acknowledged");
      MT410.U0011.TagName = ":32B:";
      MT410.U0012 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT410.U0011.Elements.Add((SwiftDefinitionElement) MT410.U0012);
      MT410.U0013 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT410.U0011.Elements.Add((SwiftDefinitionElement) MT410.U0013);
      MT410.U0007.Elements.Add((SwiftDefinitionElement) MT410.U0011);
      MT410.U0014 = new SwiftTagDefinition("AmountAcknowledged_32K", "Amount Acknowledged");
      MT410.U0014.TagName = ":32K:";
      MT410.U0015 = new SwiftTagSubItemDefinition("DayMonth", "Day/Month");
      MT410.U0014.Elements.Add((SwiftDefinitionElement) MT410.U0015);
      MT410.U0016 = new SwiftTagSubItemDefinition("NumberOfDaysMonths", "Number of Days/Months");
      MT410.U0014.Elements.Add((SwiftDefinitionElement) MT410.U0016);
      MT410.U0017 = new SwiftTagSubItemDefinition("Code", "Code");
      MT410.U0014.Elements.Add((SwiftDefinitionElement) MT410.U0017);
      MT410.U0018 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT410.U0014.Elements.Add((SwiftDefinitionElement) MT410.U0018);
      MT410.U0019 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT410.U0014.Elements.Add((SwiftDefinitionElement) MT410.U0019);
      MT410.U0007.Elements.Add((SwiftDefinitionElement) MT410.U0014);
      MT410.U0002.Elements.Add((SwiftDefinitionElement) MT410.U0007);
      MT410.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT410.U0002);
      MT410.U001A = new SwiftTagDefinition("SenderToReceiverInformation_72", "Sender to Receiver Information");
      MT410.U001A.TagName = ":72:";
      MT410.U001A.Mandatory = false;
      MT410.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT410.U001A);
    }

    public class SequenceClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT410.U0002;
        }
      }

      [Description("Sending Bank’s TRN")]
      public Tag20 SendingBanksTRN_20
      {
        get
        {
          return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U0003);
        }
      }

      [Description("Sending Bank’s TRN")]
      public Tag20 Tag20_SendingBanksTRN
      {
        get
        {
          return this.SendingBanksTRN_20;
        }
      }

      [Description("Related Reference")]
      public Tag21 RelatedReference_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U0005);
        }
      }

      [Description("Related Reference")]
      public Tag21 Tag21_RelatedReference
      {
        get
        {
          return this.RelatedReference_21;
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32A AmountAcknowledged_32A
      {
        get
        {
          return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U0008);
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32A Tag32A_AmountAcknowledged
      {
        get
        {
          return this.AmountAcknowledged_32A;
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32B AmountAcknowledged_32B
      {
        get
        {
          return new Tag32B((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U0011);
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32B Tag32B_AmountAcknowledged
      {
        get
        {
          return this.AmountAcknowledged_32B;
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32K AmountAcknowledged_32K
      {
        get
        {
          return new Tag32K((SwiftElement) this, 0, (SwiftDefinitionElement) MT410.U0014);
        }
      }

      [Description("Amount Acknowledged")]
      public Tag32K Tag32K_AmountAcknowledged
      {
        get
        {
          return this.AmountAcknowledged_32K;
        }
      }

      internal SequenceClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }
  }
}
